package com.example.finalproject;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import androidx.annotation.NonNull;

import java.util.ArrayList;
import java.util.List;

public class MyLikeAdapter extends ArrayAdapter {
    private static final String TAG ="Adapter";
    ArrayList<Database> like_list;
    public MyLikeAdapter(@NonNull Context context, int resource, ArrayList<Database> List) {
        super(context, resource,List);
        this.like_list = List;
    }
    public View getView(int position, View convertView, ViewGroup parent){
        View itemView = convertView;
        if(itemView == null){
            itemView = LayoutInflater.from(getContext()).inflate(R.layout.list_item,parent,false);
        }
        Database list1 = like_list.get(position);
        TextView name = (TextView) itemView.findViewById(R.id.list_tv1);
        name.setText(list1.getName());
        return itemView;
    }
}
